/*
 * Lab7B.cpp
 *
 *  Created on: Mar 28, 2013
 *      Author: Anthony Varghese
 *
 */

#include <iostream>
using namespace std;

void swap( int& v1, int& v2){
	int temp = v1;
	v1 = v2;
	v2 = temp;
}

void print( const char * m, const int* array, const int length){
	cout << m;
	for (int i=0; i<length; i++)
		cout << array[i] << " ";
	cout << endl;
}

int main() {
    cout << "CSIS 237 Lab 7 Part B" << endl;   // prints a greeting
    int a[] = { 1, 2, 3, 4, 5, 6};

    print( "Original array:   ", a, 6 );
    swap( a[0], a[5] );
    print( "Array after swap: ", a, 6 );

    double b[] = { 3.4, 2.98, -30.23, 78.1, 3.1415 };
//    print( "Original array: ", b, 5 );

    /* Step 4
    cout << "Step 4 ... " << endl;
    ArrayList<int> intArray(10);
    for (int i=0; i<6; i++)
    	intArray.add( a[i] );
    cout << "Contents of int ArrayList: ";
    intArray.print();

    ArrayList<double> doubleArray(10);
    for (int i=0; i<5; i++)
    	doubleArray.add( b[i] );
    cout << "Contents of double ArrayList: ";
    doubleArray.print();
     */

    /* Step 5
    cout << "Step 5 ... " << endl;
    LinkedList<int> intList;
    for (int i=0; i<6; i++)
    	intList.insert( a[i] );
    cout << "Contents of int LinkedList: "; intList.print();
    intList.swap();
    intList.searchandremove( a[0] );
    cout << "int LinkedList after swap:  "; intList.print();

    LinkedList<double> doubleList;
    for (int i=0; i<5; i++)
    	doubleList.insert( b[i] );
    cout << "Contents of double LinkedList: ";  doubleList.print();
    doubleList.swap();
    doubleList.searchandremove( b[0] );
    cout << "double LinkedList after swap:  ";  doubleList.print();
     */

    return 0;
}
